#!/bin/sh

# must not fail
set -e 

# debug
set -x 

echo "Starting $0"


EJBCAEXTRA_DISTNAME=extra_3_9_1.zip
EJBCAEXTRA_DIRNAME=extra_3_9_1
EJBCAEXTRA_SOFTLINK=extra
EJBCAEXTRA_UNPACKCMD=unzip


### ejbca ext RA
 
if [ ! -f ${DISTFILES_INSTALL}/${EJBCAEXTRA_DISTNAME} ] ; then  
    echo "copying ${EJBCAEXTRA_DISTNAME} to ${DISTFILES_INSTALL}"
    cp ${EJBCAEXTRA_DISTNAME}     ${DISTFILES_INSTALL}
fi
 

if [ -x ${EJBCAEXTRA_DIRNAME} ] ;then
    echo "${EJBCAEXTRA_DIRNAME} exists, skipping"
else

    cd ${INSTALL_INTO}
    ${EJBCAEXTRA_UNPACKCMD} ${DISTFILES_INSTALL}/${EJBCAEXTRA_DISTNAME} 
    cd -
fi


rm -f ${EJBCAEXTRA_SOFTLINK}
ln -s ${EJBCAEXTRA_DIRNAME} ${INSTALL_INTO}/${EJBCAEXTRA_SOFTLINK}


echo "End of $0"

